<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="public/theme/backend/style/vds.css" />
<link rel="stylesheet" type="text/css" href="public/theme/backend/style/main.css" />
<link rel="stylesheet" type="text/css" href="public/theme/backend/style/user.css" />
<link rel="stylesheet" type="text/css" href="public/theme/backend/style/poper.css" />
<script type="text/javascript" src="public/theme/backend/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="public/theme/backend/js/vds.js"></script>
<script type="text/javascript">
$(function(){
  $("#exp-bar").animate({width: $('#exp-bar').data('pct')}, 2000);
});

//编辑用户资料
function submitProfile(){
  var form = $('#form-profile'), mobile = form.find('input[name="mobile_no"]');
  form.find('input[name="name"]').vdsChecker({maxlength:50});
  mobile.vdsChecker({mobile:true}, {mobile:'手机号码格式不正确'}, {mobile:/^$|^1[3|4|5|8]\d{9}$/.test(mobile.val())});
  form.find('txtarea[name="signature"]').vdsChecker({maxlength:240});
  form.vdsSubmit();
}
</script>
</head>
<body>
<div class="content">
  <div class="loc"><h2><i class="icon"></i>用户信息</h2></div>
  <div class="box">
    <div class="bw-row pad5 cut">
      <h3 class="th ta-c">基本信息</h3>
      <div class="pad5">
        <table class="dataform">
          <tr>
            <th width="12%">用户名</th>
            <td width="38%"><{$rs.username}></td>
            <th width="12%">状态</th>
            <td><{if $rs.status == 1}><font class="red">限制</font><{else}><font class="green">正常</font><{/if}></td>
          </tr>
          <tr>
            <th>邮箱</th>
            <td><{$rs.email}><{if $rs.email_status == 1}><font class="green ml10">[已验证]</font><{else}><font class="red ml10">[未验证]</font><{/if}></td>
            <th>注册日期</th>
            <td><{date('Y-m-d h:i:s', $rs.actinfo.created_date)}></td>
          </tr>
          <tr>
            <th>账户经验</th>
            <td><div class="exp cut">
                <div class="bar fl" id="exp-bar" data-pct="<{$rs.account.exp_pct}>"></div>
                <div class="vals c888 fl"><{$rs.account.exp}></div>
              </div></td>
            <th>用户组</th>
            <td><{$rs.group.group_name}></td>
          </tr>
          <tr>
            <th>账户余额</th>
            <td><{$rs.account.balance}></td>
            <th>最后登陆日期</th>
            <td><{date('Y-m-d h:i:s', $rs.actinfo.last_date)}></td>
          </tr>
          <tr>
            <th>账户积分</th>
            <td><{$rs.account.points}></td>
            <th>最后登陆IP</th>
            <td><{$rs.actinfo.last_ip}></td>
          </tr>
          <tr>
            <td colspan="4">
              <div class="pad10 ta-c">
	        <a class="cbtn sm btn" onclick="popResetPwd()">重设密码</a><span class="sep20"></span>
		<a class="cbtn sm btn" onclick="popRevise()">调整账户数据</a><span class="sep20"></span>
		<a class="cbtn sm btn" href="<{url m=$MOD c='user' a='view' step='order' id=$rs.user_id}>">订单记录</a><span class="sep20"></span>
		<a class="cbtn sm btn" href="<{url m=$MOD c='user' a='view' step='account' id=$rs.user_id}>">账户记录</a><span class="sep20"></span>
		<a class="cbtn sm btn" href="<{url m=$MOD c='user' a='view' step='consignee' id=$rs.user_id}>">收件地址</a>
              </div>
            </td>
          </tr>
        </table>
      </div>
    </div>
    <!-- 用户资料开始 -->
    <div class="bw-row mt5 pad5 cut">
      <h3 class="th ta-c">用户资料</h3>
      <div class="pad5 cut">
        <form method="post" id="form-profile" enctype="multipart/form-data" action="<{url m=$MOD c='user' a='edit_profile' id=$rs.user_id}>">
          <table class="dataform">
            <tr>
              <th width="12%"><label for="name">姓名/称呼</label></th>
              <td width="38%"><input title="姓名/称呼" class="w200 txt" name="name" value="<{$rs.profile.name}>" type="text" /></td>
              <th width="12%">性别</th>
              <td>
                <label><input type="radio" name="gender" value="0" <{if $rs.profile.gender == 0}>checked="checked"<{/if}> /><font class="ml5">保密</font></label>
                <label class="ml10"><input type="radio" name="gender" value="1" <{if $rs.profile.gender == 1}>checked="checked"<{/if}> /><font class="ml5">男</font></label>
                <label class="ml10"><input type="radio" name="gender" value="2" <{if $rs.profile.gender == 2}>checked="checked"<{/if}> /><font class="ml5">女</font></label>
              </td>
            </tr>
            <tr>
              <th>头像</th>
              <td>
                <dl class="avatar cut">
                  <{if !empty($rs.profile.avatar)}><dt class="fl mr10 cut"><img id="user-avatar" width="60" height="60" src="./upload/user/avatar/<{$rs.profile.avatar}>" /></dt><{/if}>
                  <dd class="pad5 cut">
                    <p><input name="avatar" id="avatar" type="file" /></p>
                    <p class="light-gray mt10">仅允许上传 "png" "jpg" "jpeg" "gif" 类型的图片</p>
                  </dd>
                </dl>
              </td>
              <th>个性签名</th>
              <td><textarea class="txtarea" name="signature" cols="60" rows="4"><{$rs.profile.signature}></textarea></td>
            </tr>
            <tr>
              <th>手机号码</th>
              <td><input title="手机号码" class="w200 txt" name="mobile_no" value="<{$rs.profile.mobile_no}>" type="text" /></td>
              <th>出生日期</th>
              <td>
                <select class="slt" name="birth_year"><{html_date_options type="year" default=$rs.profile.birth_year}></select>
                <select class="slt" name="birth_month"><{html_date_options type="month" default=$rs.profile.birth_month}></select>
                <select class="slt" name="birth_day"><{html_date_options type="day" default=$rs.profile.birth_day}></select>
              </td>
            </tr>
            <tr>
              <th>QQ 号码</th>
              <td><input title="QQ 号码" class="w200 txt" name="qq" value="<{$rs.profile.qq}>" type="text" /></td>
            </tr>
            <tr>
              <td colspan="4">
                <div class="pad10 ta-c">
                  <button type="button" class="ubtn btn" onclick="submitProfile()">保存并更新资料</button>
                  <span class="sep20"></span>
                  <button type="reset" class="ubtn btn">重置表单</button>
                </div>
              </td>
            </tr>
          </table>
        </form>
      </div>
    </div>
    <!-- 用户资料结束 -->
  </div>
  </form>
</div>
<{include file='backend/user/reset_pwd.html'}>
<{include file='backend/user/revise_account.html'}>
</body>
</html>